package com.yunche.yunchebusiness.base

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import android.support.multidex.MultiDex
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import com.orhanobut.logger.PrettyFormatStrategy

/**
 * Create by Crcker on 2018/12/20 11:06
 * Email: Crcker@163.com
 */


class BaseApp : Application() {

    companion object {
        @SuppressLint("StaticFieldLeak")
        var mContext: Context? = null
        var screenWidth = 0
    }


    override fun onCreate() {
        super.onCreate()
        mContext = this
        initLogger()
        MultiDex.install(this)
    }


    private fun initLogger() {
        val formatStrategy = PrettyFormatStrategy.newBuilder()
            .showThreadInfo(false)
            .methodCount(0)
            .methodOffset(7)
            .tag("花里胡哨")
            .build()
        Logger.addLogAdapter(AndroidLogAdapter(formatStrategy))
    }
}